#include <stdio.h>

int main()
{
  int A, B, C, W, L, L1, M1, M2, i;
  for (A = 3; A <= 9; A++)
    for (B = 0; B <= 9; B++)
      for (C = 0; C <= 9; C++)
      {
        W = A * 10000 + B * 1000 + C * 100 + A * 10 + B;
        L = W * A;
        L1 = L;
        M1 = L1 % 10;
        for (i = 1; i <= 5; i++)
        {
          M2 = M1;
          L1 = L1 / 10;
          M2 = L1 % 10;
          if (M1 != M2)
            break;
        }
        if (i == 6)
          printf("%d * %d = %d\n", W, A, L);
      }
}